﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace HMI.UIFrms
{
    /// <summary>
    /// LineSetBox.xaml 的交互逻辑
    /// </summary>
    public partial class LineSetBox : Window
    {
        public LineSetBox()
        {
            InitializeComponent();
            tit.CloseFrm += (object sender, RoutedEventArgs e) => {
                this.Close();
            };
            tit.MinFrm += (object sender, RoutedEventArgs e) => {
                this.WindowState = WindowState.Minimized;
            };
            tit.MouseLeftButtonDown += (object sender, MouseButtonEventArgs e) =>
            {
                switch (e.ClickCount)
                {
                    case 1:
                        this.DragMove();
                        break;
                }
            };
        }
        public string LabelTxt
        {
            get { return Convert.ToString(lab.Content); }
            set { lab.Content = value; }
        }
        public string TxtContent
        {
            get { return Convert.ToString(txtc.Text); }
            set { txtc.Text = value; }
        }
        public Action<string> SetValue { get; set; }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (SetValue != null)
            {
                SetValue(TxtContent);
                this.Close();
            }
        }
    }
}
